package com.template.api.controller.config;

import com.template.api.entity.vo.ResultConfigBannerVO;
import com.template.api.service.config.CliConfigBannerService;
import com.template.common.constant.ApiGroup;
import com.template.common.constant.ApiLine;
import com.template.common.constant.ApiVersion;
import com.template.common.constant.CommonResult;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 客户端·Banner配置·Controller
 * @author mltong
 */
@RestController
@RequestMapping(ApiLine.CLI + ApiGroup.CONFIG)
public class CliConfigBannerController {

    @Resource
    private CliConfigBannerService service;

    /**
     * 客户端Banner列表
     * @param scope Banner作用范围(HomePageBanner:首页Banner,MyPageBanner:我的页面Banner)
     * @return
     */
    @GetMapping(ApiVersion.VERSION_202505 + "/banner")
    public CommonResult<List<ResultConfigBannerVO>> listBanner(@RequestParam("scope") String scope) {
        return CommonResult.success(service.listBanner(scope));
    }

}
